<?php
namespace app\admin\controller;

class Account extends Base
{
    /**
     * @return string
     * 创建后台账户
     */
        public function createDefaultAccount()
        {
            $account = D('account');
            $data['account'] = 'admin';
            $res = $account->where('account',$data['account'])->where('enable',0)->find();
            if ($res){
                return "创建成功";
            }
            $passwd = '123456';
            $data['passwd'] = md5(md5($passwd).config('keys'));
            $account->insert($data);
            return "创建成功";
        }
    
    
}
